import { PanelComponentMap } from '../constants'
import BasePanel from './panel'

export const RightPanel = ({ node, closePanel }) => {
  const nodeData = node.data
  const NodeComponent = PanelComponentMap[nodeData.type]

  return (
    <>
      <BasePanel id={node.id} data={nodeData} closePanel={closePanel}>
        <NodeComponent />
      </BasePanel>
    </>
  )
}

RightPanel.displayName = 'RightPanel'

export default RightPanel
